const url = require('url')

var api = 'http://www.baidu.com?name=limi&age=30'

// console.log(url.parse(api, true))

var value = url.parse(api, true).query
console.log(value)
console.log(`姓名：${value.name}---年龄：${value.age}`)